]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot-ui: Extract binding modes
authorIvan Molodetskikh <yalterz@gmail.com>
Thu, 3 Feb 2022 19:40:23 +0000 (22:40 +0300)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Feb 2022 12:13:22 +0000 (12:13 +0000)
We will re-use the same modes for more bindings in subsequent commits.
Also, while we're at it, invert the modes, to emphasize where the
screenshot UI cannot be used, rather than where it can be used.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107>

js/ui/screenshot.js

index ad81c55126667de106b71fc42ebe4fdfe2070bc7..2b70d1d0cfcedd99d15f769139fc78a8cfe967ad 100644 (file)
@@ -1275,15 +1275,17 @@ var ScreenshotUI = GObject.registerClass({
             this._rebuildMonitorBins();
         });
 
+        const uiModes =
+            Shell.ActionMode.ALL &
+            ~(Shell.ActionMode.LOCK_SCREEN |
+                Shell.ActionMode.UNLOCK_SCREEN |
+                Shell.ActionMode.LOGIN_SCREEN);
+
         Main.wm.addKeybinding(
             'show-screenshot-ui',
             new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
             Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
-            Shell.ActionMode.NORMAL |
-            Shell.ActionMode.OVERVIEW |
-            Shell.ActionMode.SYSTEM_MODAL |
-            Shell.ActionMode.LOOKING_GLASS |
-            Shell.ActionMode.POPUP,
+            uiModes,
             showScreenshotUI
         );
     }